home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mntdoc01.zoo / mintdoc / cat3 / lseek.3 < prev    next >
Encoding:
Text File  |  1993-03-03  |  1.6 KB  |  67 lines

  1.  
  2.  
  3.  
  4. LSEEK(3)            MINTLIB LIBRARY FUNCTIONS            LSEEK(3)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        lseek, tell - move read/write file pointer
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        #include <unistd.h>
  12.  
  13.        long lseek(int fildes, long offset, int mode);
  14.  
  15.        long tell(int fd);
  16.  
  17. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  18.        fildes  is  a file descriptor returned from a creat, open,
  19.        dup, or fcntl system call. lseek  sets  the  file  pointer
  20.        associated  with  fildes as follows, according to value of
  21.        the mode paramater:
  22.        - SEEK_SET (0): the pointer  is  set  to  offset  bytes  -
  23.        SEEK_CUR (1): the pointer is set to its current
  24.                        location  plus  offset - SEEK_END (2): the
  25.        pointer is set to the size of
  26.                        the file plus offset
  27.  
  28.        If the seek would set the pointer beyond the  end  of  the
  29.        file,  and  the  file  is  then  written  to,  the file is
  30.        extended with zeros.  If the  filesystem  supports  sparse
  31.        files, this may not take much space on disc.
  32.  
  33.        The obsolete function tell(fd) is equivalent to:
  34.          lseek(fd, 0L, SEEK_CUR).
  35.  
  36. R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
  37.        On  success,  the  new  position  of  the  file pointer is
  38.        returned.  On failure, a negative number is returned,  and
  39.        errno is set.
  40.  
  41. S✓SE✓EE✓E A✓AL✓LS✓SO✓O
  42.        c✓cr✓re✓ea✓at✓t(✓(3✓3)✓),✓, d✓du✓up✓p(✓(3✓3)✓),✓, f✓fc✓cn✓nt✓tl✓l(✓(3✓3)✓),✓, f✓fs✓se✓ee✓ek✓k(✓(3✓3)✓),✓, o✓op✓pe✓en✓n(✓(3✓3)✓),✓, F✓Fs✓se✓ee✓ek✓k(✓(2✓2)✓)
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. MiNT docs 0.1              3 March 1993                         1
  65.  
  66.  
  67.